﻿<Window x:Class="WpfCardGame.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:views="clr-namespace:WpfCardGame.Views"
        xmlns:local="clr-namespace:WpfCardGame.ViewModel"
        Title="MainWindow" Height="575" Width="862"
        ResizeMode="CanMinimize">

    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="BoolToVis" />
    </Window.Resources>

    <Window.DataContext>
        <local:MainViewModel/>
    </Window.DataContext>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="auto"/>
            <ColumnDefinition Width="auto"/>
        </Grid.ColumnDefinitions>

        <Button x:Name="btnBJ" 
                Grid.Row="0"
                Grid.Column="0"
			    Content="BlackJack Game" 
			    HorizontalAlignment="Left" 
			    Height="33" 
			    Margin="5,5,5,5" 
			    VerticalAlignment="Top" 
			    Width="103"
                Command="{Binding ChangeCommand}"
                CommandParameter="BJ">
        </Button>
        <Button x:Name="btnWar" 
                Grid.Row="0"
                Grid.Column="1"
			    Content="War Game" 
			    HorizontalAlignment="Left" 
			    Height="33" 
			    Margin="5,5,5,5" 
			    VerticalAlignment="Top" 
			    Width="103"
                Command="{Binding ChangeCommand}"
                CommandParameter="War">
        </Button>
        <Button x:Name="btnPoker" 
                Grid.Row="0"
                Grid.Column="2"
			    Content="Poker Game" 
			    HorizontalAlignment="Left" 
			    Height="33" 
			    Margin="5,5,5,5" 
			    VerticalAlignment="Top" 
			    Width="103"
                Command="{Binding ChangeCommand}"
                CommandParameter="Poker">
        </Button>

        <StackPanel Grid.Row="1" 
                    Grid.Column="0" 
                    Grid.ColumnSpan="3"
                    Visibility="{Binding ShowBJView, Converter={StaticResource BoolToVis}}">

            <views:BJView></views:BJView>

        </StackPanel>

        <StackPanel Grid.Row="1" 
                    Grid.Column="0" 
                    Grid.ColumnSpan="3"
                    Visibility="{Binding ShowWarView, Converter={StaticResource BoolToVis}}">

            <views:WarView></views:WarView>

        </StackPanel>

        <StackPanel Grid.Row="1" 
                    Grid.Column="0" 
                    Grid.ColumnSpan="3"
                    Visibility="{Binding ShowPokerView, Converter={StaticResource BoolToVis}}">

            <views:PokerView></views:PokerView>

        </StackPanel>

    </Grid>

</Window>
